﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Operations;

namespace Mes.Application.Web.Validators.ProcessRoute
{
    public class AddProcessRouteInputValidator : AbstractValidator<AddProcessRouteInput>
    {
        public AddProcessRouteInputValidator()
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage("工艺路线名称不能为空")
                              .Length(1, 50).WithMessage("工艺路线长度必须在1到50之间");
            RuleFor(x => x.Code).NotEmpty().WithMessage("工艺路线编码不能为空")
                               .Length(1, 50).WithMessage("工艺路线编码长度必须在1到50之间");
            RuleFor(x => x.Remark).Length(0, 200).WithMessage("备注长度必须在0到200之间");
        }
    }
}
